package com.dzx.awt;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年07月22日 11:52:08
 */
public class ImageDemo {
    private final int WIDTH = 80;
    private final int HEIGHT = 60;
    BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_BGR);
    Graphics g = image.getGraphics();

    public void zoom() throws IOException {
        Image srcImage = ImageIO.read(new File("C:\\Users\\段朝旭\\Desktop\\月卡分组会员流程图.jpg"));
        g.drawImage(srcImage, 0, 0, WIDTH,HEIGHT,null);
        ImageIO.write(image, "jpg", new File("C:\\Users\\段朝旭\\Desktop\\1.jpg"));
    }

    public static void main(String[] args) throws IOException {
        new ImageDemo().zoom();
    }
}
